//
//  NewsViewController.m
//  项目一
//
//  Created by 芮京 on 2018/9/28.
//  Copyright © 2018 芮京. All rights reserved.
//

#import "NewsViewController.h"
#import "ToutiaoViewController.h"
#import "tiyuViewController.h"
#import "KejiViewController.h"
#import "yuleViewController.h"
#import "CaijingViewController.h"
#import "GentieViewController.h"
#import "QingsongViewController.h"


#import "SCNavTabBarController.h"
@interface NewsViewController ()

@end

@implementation NewsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //主题SCNav
    [self creat];
    
    
    
}
-(void)creat{
    //创建视图控制器
    ToutiaoViewController * toutiao = [[ToutiaoViewController alloc]init];
    toutiao.title = @"头条";
    yuleViewController * yule = [[yuleViewController alloc]init];
    yule.title = @"娱乐";
    tiyuViewController * tiyu = [[tiyuViewController alloc]init];
    tiyu.title = @"体育";
    CaijingViewController * caijing = [[CaijingViewController alloc]init];
    caijing.title = @"财经";
    KejiViewController * keji = [[KejiViewController alloc]init];
    keji.title = @"科技";
    GentieViewController * gentie = [[GentieViewController alloc]init];
    gentie.title = @"跟帖";
    QingsongViewController * qingsong = [[QingsongViewController alloc]init];
    qingsong.title = @"轻松一刻";
    
    
    //1、创建SCNavTabBar
    SCNavTabBarController * scNav = [[SCNavTabBarController alloc]init];
    //2、进行管理所需展示视图
    scNav.subViewControllers =[NSMutableArray arrayWithArray: @[toutiao,yule,tiyu,caijing,keji,gentie,qingsong]];
    //更改导航栏位置颜色
    [scNav setNavTabBarColor:[UIColor blackColor]];
    //3、执行管理
    [scNav addParentController:self];
    
    
   
}
//隐藏系统导航栏
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];//调用父类方法
    self.navigationController.navigationBarHidden = YES;
    //更改状态栏样式
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
    
}
-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];//调用父类方法
    self.navigationController.navigationBarHidden = NO;
}
@end
